#pragma once

#include <exception>
#include "EIterator.h"
using namespace std;

#define VECTOR_DEFAULT_LEN 20
#define VECTOR_RESIZE_FACTOR 2


class OutOfIndexException:public std::exception
{

};

template <typename Item>
class EVector;

template<typename Item>
class EVectorIterator:public EIterator<Item>
{
public:
	EVectorIterator(EVector<Item> *vector) { _vector = vector; _position = 0;}
	void operator++() = 0;
	void operator++(int i = 0) = 0;
	Item& operator*() = 0;
	Item* operator->() = 0;
	bool IsDone() = 0;
private:
	EVector<Item> *_vector;
};

template<typename Item>
class EVector
{
	
public:
	typedef typename Item ValueType;

public:
	EVector(void);
	~EVector(void);
	void DefEVectorCtr(void);
	const Item& operator[](int) const;
	int GetSize(){ return _size;}
	int GetCapacity(){ return _capacity;}
	void resize();
	void push_back(Item&);
	void insert(EIterator<Item>* , Item&);
	void remove(EIterator<Item>*);
	
private:
	Item *_container;
	int _size;
	int _capacity;
	EVectorIterator<Item> _begin;
};

